package com.thenie.chat.controller;

import com.thenie.chat.service.IUserService;
import com.thenie.chat.vo.LoginVo;
import com.thenie.chat.vo.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * @Description 登陆处理器
 * @Author thenie
 * @Data 2022/5/17 10:08
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private IUserService userService;
    /**
     * 登录
     * @param loginVo
     * @param req
     * @param resp
     * @return
     */
    @PostMapping("/doLogin")
    public RespBean doLogin(@Valid LoginVo loginVo, HttpServletRequest req, HttpServletResponse resp){

        return userService.doLogin(loginVo,req,resp);
    }



}
